/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.myapp.util;

import java.lang.reflect.Method;

/**
 *
 * @author toint
 */
public class ReflectUtil {
      public static Method findFirstMethod(Class source, String methodName)
  {
    Method result = null;
    Method[] listOfMethods = source.getMethods();
    for (int i = 0; i < listOfMethods.length; i++)
    {
      if (!listOfMethods[i].getName().equals(methodName))
        continue;
      result = listOfMethods[i];
      break;
    }

    return result;
  }
}
